package com.sdweizan.sdk.bytedance.api.impl;

import com.alibaba.fastjson.TypeReference;
import com.sdweizan.sdk.bytedance.api.BdMiniAppService;
import com.sdweizan.sdk.bytedance.api.BdOpenService;
import com.sdweizan.sdk.bytedance.bean.schema.BdUrlLinkGenerateRequest;
import com.sdweizan.sdk.bytedance.bean.schema.BdUrlLinkGenerateResponse;
import com.sdweizan.sdk.bytedance.constants.BdConstants;
import com.sdweizan.sdk.bytedance.util.HttpClientPostRequestExecutor;
import com.sdweizan.sdk.bytedance.util.JsonUtils;
import lombok.AllArgsConstructor;

import java.util.HashMap;
import java.util.Map;

@AllArgsConstructor
public class BdLinkService {
  private final BdOpenService bdOpenService;

  public BdUrlLinkGenerateResponse generateUrlLink(
      BdUrlLinkGenerateRequest bdUrlLinkGenerateRequest) throws Exception {
    return bdOpenService.post(
        bdUrlLinkGenerateRequest, new TypeReference<BdUrlLinkGenerateResponse>() {});
  }
}
